package com.pokerpro.model;

/**
 * 2-9, 10, jack, queen, king, ace
 * @author Alex
 *
 */
public class Card {
	
	private String value;
	private String suit;
	
	public Card () {
		value = "";
		suit = "";
	}
	
	public Card (String card) {
		String[] tempString = card.split(":");
		value = tempString[0];
		suit = tempString[1];
	}
	
	public String getCardString() {
		return value + ":" + suit;
	}

	public String getValue() {
		return value;
	}
	
	public int getValueAsInt() {
		int result = 1;
		
		if (value.equals("2"))
			result = 2;
		if (value.equals("3"))
			result = 3;
		if (value.equals("4"))
			result = 4;
		if (value.equals("5"))
			result = 5;
		if (value.equals("6"))
			result = 6;
		if (value.equals("7"))
			result = 7;
		if (value.equals("8"))
			result = 8;
		if (value.equals("9"))
			result = 9;
		if (value.equals("10"))
			result = 10;
		
		if (value.equals("jack"))
			result = 11;
		if (value.equals("queen"))
			result = 12;
		if (value.equals("king"))
			result = 13;
		if (value.equals("ace"))
			result = 1;
		return result;
	}

	public String getSuit() {
		return suit;
	}
}
